package com.atguigu1.core.io

import org.apache.spark.{SparkConf, SparkContext}

/**
 *
 * @description: xxx
 * @time: 2021-03-17 17:52
 * @author: baojinlong 
 **/
object Spark02IoRead {
  def main(args: Array[String]): Unit = {
    val conf: SparkConf = new SparkConf().setMaster("local[*]").setAppName("persistDemo")
    // 设置rdd分区数字
    val sparkContext = new SparkContext(conf)
    println(sparkContext.textFile("output1").collect.mkString(","))
    println(sparkContext.objectFile[(String, Int)]("output2").collect.mkString(","))
    println(sparkContext.sequenceFile[String, Int]("output3").collect.mkString(","))
  }

}
